<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		input{
			border: 1px solid red;
		}
	</style>
</head>
<body>
	<input type="text" name="" value=""><button>天选之子</button>
<script type="text/javascript">
	//let arr = ["熊大", "熊二", "光头强", "吉吉国王"] 一组数据，每次点击随机抽取一个，显示在input里。随机数的方法是Math.random(),返回0-1之间的随机数字

	 let arr = ["熊大", "熊二", "光头强", "吉吉国王"] 
	 let input = document.querySelector('input')
	 let but = document.querySelector('button')
	 input.value = arr[0]
	 but.addEventListener('click',function(){
	 	let index = parseInt(Math.random()* arr.length)
	 	// console.log(index)
	 	input.value = arr[index]

	 })
	
</script>
</body>
</html>